package com.woniu.shop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.shop.pojo.StoreService;
import org.apache.ibatis.annotations.*;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 门店服务表 Mapper 接口
 * </p>
 *
 * @author LiFangyu
 * @since 2023-02-15
 */
public interface StoreServiceMapper extends BaseMapper<StoreService> {

    @Update("UPDATE t_store_service set service_status = #{status} WHERE id = #{id};")
    Integer updateStatus(@Param("id") String id,@Param("status") String status);


    @Select("select * from t_store_service where service_status = 1 and is_deleted = 0 and service_type_id=#{id}")
    List<StoreService> queryByType(@Param("id") String id);


    @Update("UPDATE t_store_service set service_star= #{score} WHERE id=#{serviceId};")
    void setServiceStar(@Param("score") BigDecimal score, @Param("serviceId") String serviceId);
}
